Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-milestone is "x-login">

It allows to Login to Milestone VMS with a basic user account with administrator role. Allows you to receive both the token for the REST and for the SOAP api with the same credentials.

Inputs

There aren't inputs. The credentials required for login are entered in the node properties and they are as follows:

Address string
The hostname where the Milestone VMS runs on. Only http or https are allowed (mandatory)
Username string
The username present in the Milestone VMS, registered as basic user (mandatory)
Password string
A valid password for the username above (mandatory)

Outputs

JSON object with these properties:

tokenRest string
The access Token for the rest APIs if the login was successful, null otherwise
tokenSOAP string
The access Token for the SOAP calls if the login was successful, null otherwise
expireRest number
The expire time of access Token for the rest APIs if the login was successful, null otherwisee
expireSOAP number
The expire time of access Token for the SOAP calls if the login was successful, null otherwise
error string
The error generated by an incorrect login, null otherwise

Example of JSON output if login works:

{
   tokenREST: "eyJhbOciODSUzI1NiIsImtpZCI6Ij",
   tokenSOAP: "TOKEN#85c18f10-e479-44c0- 9af7", 
   expireREST: 3600, 
   expireSOAP: 14400, 
   error: null
}
      

Example of JSON output of incorrect login:

{
   tokenREST: null,
   tokenSOAP: null,
   expireREST: null,
   expireSOAP: null,
   error: "invalid_password"
}
     

Details

The node can receive the parameters described above in the node properties. If they are not present or are wrong, an error is generated for the necessary parameters or the reason why are not correct.